package com.zhuiYun.project.api.hotSellingList.controller;
/**
 * @author syc
 * @date 2023/4/5 9:23
 */

import com.zhuiYun.project.api.hotSellingList.service.HotService;
import com.zhuiYun.project.common.controller.BaseController;
import com.zhuiYun.project.common.errorCode.CommonException;
import com.zhuiYun.project.common.response.CommonResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @ClassName hotSellinglistcontroller
 * @Description TODO
 * @Author 商品热销top10
 * @Date 2023/4/5 9:23
 **/
@CrossOrigin
@RestController
@RequestMapping("/hotSellinglist")
@Slf4j
public class hotSellinglistcontroller extends BaseController {

    @Autowired
    HotService hotService;
    /**
    * @Author
        

     *
    * @Description 通过类型查询热销榜前十
    * @Date 2023/4/6 10:18
    * @Return com.zhuiYun.project.common.response.CommonResult
    * @param
    */
    @GetMapping("/CommodityBytypeId")
    @ApiOperation(value = "通过类型查询热销榜前十")
    public CommonResult HotCommodity() throws CommonException {
        log.info("通过类型查询热销榜前十");
        CommonResult commonResult=hotService.CommodityByTypeId();
        System.out.println("commonResult::"+commonResult);
        return commonResult;
    }

}
